package com.matt.controller;

import com.matt.commons.model.StatusResponse;
import com.matt.service.SchedulerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/7/25
 * *******************************
 */
@RestController
@RequestMapping("/scheduler")
public class SchedulerController {
    @Autowired
    private SchedulerService schedulerService;

    @RequestMapping(value = "/daily")
    public StatusResponse daily(String time){
        Boolean result = schedulerService.dailyClearTask(time);
        return StatusResponse.success(result);
    }


    @RequestMapping(value = "/hourly")
    public StatusResponse hourly(String time){
        Boolean result = schedulerService.hourlyClearTask(time);
        return StatusResponse.success(result);
    }

}
